import { showToast } from "vant";
import { requestGet, requestPost } from "@/utils/http";

const baseUrl = "/tour_order_disparity";
export const infoApi = (data: { disparity_id: string }, showError = true) => {
  return requestPost<null | any>(`/v1${baseUrl}/refund_info`, data).catch(
    (error: Error) => {
      showError && showToast(error.message);
      return Promise.reject(error);
    }
  );
};
export const payApi = (
  data: { disparity_id: string; openid?: string },
  showError = true
) => {
  return requestPost<any>(`/v1${baseUrl}/get_refund`, data).catch(
    (error: Error) => {
      showError && showToast(error.message);
      return Promise.reject(error);
    }
  );
};
